﻿
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

namespace MainMenu
{
    public class GameModePanel : ShowHidable
    {
        /// <summary>
        /// 背景图
        /// </summary>
        public RawImage bg;

        public override void Show(bool animate = true, Action completed = null)
        {
            //base.Show(animate, completed);
            gameObject.SetActive(true);
        }

        public void OnClickButton(int mode)
        {
            var levelsPanel = UIManager.Instance.LevelsPanel;
            levelsPanel.GameMode = (GameMode)mode;
            levelsPanel.Show();
        }

        /// <summary>
        /// 设置背景图
        /// </summary>
        /// <param name="setbg">背景图</param>
        public void setbg(Texture setbg)
        {
            if (bg)
                bg.texture = setbg;
        }
    }
}